<?php

namespace ApiSdk\Kwaixiaodian;

use ApiSdk\Kwaixiaodian\Facade\KwaixiaodianPackage;
use Illuminate\Support\ServiceProvider as Service;

class ServiceProvider extends Service
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //这里使用到了facades中的字符串
        $this->app->singleton('Kwaixiaodian',function(){
            return new KwaixiaodianPackage();

            //我们可以通过facades的aliase访问下面的MoreAction
            //会在config的app.php文件中进行服务提供者和别名的注册
//            return $this->app->make('ArcherWong\LaraPackage\MoreAction');
        });
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes([
                             __DIR__ . '/config/kwaixiaodian.php' => config_path('platform/kwaixiaodian.php'), // 发布配置文件到 laravel 的config 下
                         ]);
    }
}
